//
//  UIView+UIViewRect.m
//  BJEVChargingBar
//
//  Created by up72_01 on 15/11/9.
//  Copyright © 2015年 up72_01. All rights reserved.
//

#import "UIView+UIViewRect.h"

@implementation UIView (UIViewRect)


- (void)setFrameX:(CGFloat)x {
    CGRect rect = self.frame;
    [self setFrame:CGRectMake(x, rect.origin.y, rect.size.width, rect.size.height)];
}

- (void)setFrameY:(CGFloat)y {
    CGRect rect = self.frame;
    [self setFrame:CGRectMake(rect.origin.x, y, rect.size.width, rect.size.height)];
}

- (void)setFrameXAndY:(CGFloat)x y:(CGFloat)y {
    CGRect rect = self.frame;
    [self setFrame:CGRectMake(x, y, rect.size.width, rect.size.height)];
}

- (void)setFrameWidth:(CGFloat)width {
    CGRect rect = self.frame;
    [self setFrame:CGRectMake(rect.origin.x, rect.origin.y, width, rect.size.height)];
}

- (void)setFrameHeight:(CGFloat)height {
    CGRect rect = self.frame;
    [self setFrame:CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, height)];
}

- (void)setFrameWidthAndHeight:(CGFloat)width height:(CGFloat)height {
    CGRect rect = self.frame;
    [self setFrame:CGRectMake(rect.origin.x, rect.origin.y, width, height)];
}


@end
